﻿using blackhouse.IdentityCms.Data;

namespace blackhouse.IdentityCms.Business.Templates {

    public class CmsPageTemplate : IPageTemplate {

        #region Fields

        //private readonly ITemplateDbContext dbContext;

        #endregion

        #region Properties

        public int TemplateId {
            get;
            private set;
        }
        public string Name { get; set; }
        public string Description { get; set; }

        #endregion

        #region Constructors

        public CmsPageTemplate() {
            //this.dbContext = DbFactory.GetTemplateDbContext();
        }

        public CmsPageTemplate(TemplateData data)
            : this() {
            this.ReadTemplate(data);
        }

        #endregion

        #region Methods

        private void ReadTemplate(TemplateData data) {
            if (data.Id == 0) return;
            this.TemplateId = data.Id;
            this.Name = data.Name;
            this.Description = data.Description;
        }

        #endregion

    }
}
